<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // class Vehicle {
    //   constructor() {
    //     this.hasEngine = true
    //   }
    // }
    // class Bus extends Vehicle {
    //   constructor() {
    //     // 不要在super之前使用this
    //     super()
    //     console.log(this instanceof Vehicle)
    //   }
    // }
    // console.log(new Bus())
    class Vehicle { }
    class Car extends Vehicle { }
    class Bus extends Vehicle {
      constructor() {
        super()
      }
    }
    class Van extends Vehicle {
      constructor() {
        return {}
      }
    }
    console.log(new Car())
    console.log(new Bus())
    console.log(new Van())
    // 在静态方法中可以使用super调用继承的类上面定义的方法
  </script>
</body>

</html>
